Re-land PR #72388: Recursively expand TokenKind::Interpolated in probably_equal_for_proc_macro#73084
Merged
bors merged 2 commits intorust-lang:masterfrom Aug 23, 2020
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #72388 allowed us to preserve the original
TokenStreamin more cases during proc-macro expansion, but had to be reverted due to a large number of regressions (See #72545 and #72622). These regressions fell into two categoriesGroups withDelimiter::None, which are inserted duringmacro_rules!expansion (but are lost during stringification and re-parsing). A large number of these regressions were due tosynandproc-macro-hack, but several crates needed changes to their own proc-macro code.quote_spanned!). However, two crates had intentionally written unhygenicmacro_rules!macros, which were able to access identifiers that were not passed as arguments (see Crater run for PR #72388 - Recursively expandTokenKind::Interpolatedinprobably_equal_for_proc_macro#72622 (comment)).All but one of the Crater regressions have now been fixed upstream (see https://hackmd.io/ItrXWRaSSquVwoJATPx3PQ?both). The remaining crate (which has a PR pending at sammhicks/face-generator#1) is not on
crates.io, and is a Yew application that seems unlikely to have any reverse dependencies.As @petrochenkov mentioned in #72545 (comment), not re-landing PR #72388 allows more crates to write unhygenic
macro_rules!macros, which will eventually stop compiling. Since there is only one Crater regression remaining, since additional crates could write unhygenicmacro_rules!macros in the time it takes that PR to be merged.